<!--
  ~
  ~   ~ MIT License
  ~   ~
  ~   ~ Copyright (c) 2021-2022 yangrunkang
  ~   ~
  ~   ~ Author: yangrunkang
  ~   ~ Email: yangrunkang53@gmail.com
  ~   ~
  ~   ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~   ~ of this software and associated documentation files (the "Software"), to deal
  ~   ~ in the Software without restriction, including without limitation the rights
  ~   ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~   ~ copies of the Software, and to permit persons to whom the Software is
  ~   ~ furnished to do so, subject to the following conditions:
  ~   ~
  ~   ~ The above copyright notice and this permission notice shall be included in all
  ~   ~ copies or substantial portions of the Software.
  ~   ~
  ~   ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~   ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~   ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~   ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~   ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~   ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  ~   ~ SOFTWARE.
  ~
  -->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="index">
<!--css-->
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="${ossStatic} + @{/css/operate/daily-points.css}"/>
<!--脚本-->
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/operate/daily-points.js}"></script>
<!--内容-->
<div th:fragment="content">
    <div class="container">
        <div class="row g-2">
            <div class="col-lg-9 mb-2">
                <div class="card border-0 rounded-3 p-2">
                    <!--未登录提示-->
                    <div th:replace="fragments/index::user_not_login"></div>
                    <!--签到-->
                    <div class="checkin-wrapper pb-2" th:if="!${dailyPoints}">
                        <a href="javascript:;" class="checkin-btn" style="text-decoration: none" onclick="dailyPoints()">
                            立即签到
                        </a>
                    </div>
                    <p th:if="${dailyPoints}" style="text-align: center;color: #7D8B99" class="mt-4">
                        <span style="color: #399242;font-size:50px;">已签到</span>
                    </p>
                    <div>
                        <div class="table-responsive fixed-table-body">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <td class="fw-bold" style="width: 8%;text-align: center">序号</td>
                                    <td class="fw-bold" style="width: 68%;">积分描述</td>
                                    <td class="fw-bold" style="width: 24%;">时间</td>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:if="!${#lists.isEmpty(listIntegralDto.memberIntegralEnhanceList)}"
                                    th:each="memberIntegralEnhance,ite : ${listIntegralDto.memberIntegralEnhanceList}"
                                >
                                    <td th:text="${ite.count}" style="text-align: center"></td>
                                    <td>
                                        <p th:utext="${memberIntegralEnhance.memberIntegral.integralText} +${memberIntegralEnhance.memberIntegral.integralValue > 0 ? ' +':' '}+ ${memberIntegralEnhance.memberIntegral.integralValue}"></p>
                                    </td>
                                    <td th:text="${memberIntegralEnhance.createDate}">创建时间</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div th:if="${#lists.isEmpty(listIntegralDto.memberIntegralEnhanceList)}" th:include="fragments/index::empty_content"></div>
                    <div th:replace="fragments/page::page(${listIntegralDto.pageDtoList})"></div>
                </div>
            </div>
            <div class="col-lg-3">
                <div class="card border-0 rounded-3 p-2 mb-2" th:if="!${#lists.isEmpty(listDailyPointsMemberDto.memberEnhanceList)}">
                    <div class="border-bottom mb-2">今天签到用户</div>
                    <a class="cv-link"
                       th:each="memberEnhance,ite : ${listDailyPointsMemberDto.memberEnhanceList}"
                       th:inline="text"
                       th:href="${'/profile/'+ memberEnhance.member.userId}+'/content'">
                        [[${ite.count} +'. ']]<img th:data-src="${memberEnhance.member.via}" class="lazyload cv-icon img rounded" th:alt="${memberEnhance.member.userName}" /> [[${memberEnhance.member.userName}]]
                        <br />
                    </a>
                </div>
                <div class="card border-0 rounded-3 p-2 mb-2">
                    <div class="nav flex-column nav-pills">
                        <a class="nav-link cv-link p-2" href="/user/manage/integral-record">
                            <img th:data-src="${ossStatic} + @{/icons/system/jifen2.svg}"  class="lazyload cv-icon-item" alt="查看我的积分"/> 查看我的积分
                            <span th:if="${session?.cv_user_id}" class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark">[[${listIntegralDto.totalIntegral}]]</span>
                        </a>
                        <a class="nav-link cv-link p-2" href="/integral-rules">
                            <img th:data-src="${ossStatic} + @{/icons/system/rule.png}"  class="lazyload cv-icon-item" alt="积分规则"/> 积分规则
                        </a>
                    </div>
                </div>
                <div th:include="fragments/index::global_search"></div>
                <div th:replace="fragments/index::user_manage_fragment(true)"></div>
                <div th:include="fragments/index::google_right_ad"></div>
            </div>
        </div>
    </div>
</div>
</html>
